package ${package}.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import ${package}.mapper.${TableName}Mapper;
import ${package}.entity.${TableName};
import org.springframework.stereotype.Service;
import java.io.Serializable;
import java.util.Calendar;
/**
* <p>
* ${tableComment!} 服务实现类
* </p>
*
* @author mengshx
* @since 2024-07-11
*/
@Service("${tableName}Service")
public class ${TableName}Service extends ServiceImpl<${TableName}Mapper, ${TableName}>  {
    @Override
    public boolean save(${TableName} ${tableName}) {
        if (${tableName} != null) {
            ${tableName}.setCreatedTime(Calendar.getInstance().getTime());
            ${tableName}.setUpdatedTime(${tableName}.getCreatedTime());
            return super.save(${tableName});
        }
        return false;
    }
    @Override
    public boolean updateById(${TableName} ${tableName}) {
        if (${tableName} != null) {
            ${tableName}.setUpdatedTime(Calendar.getInstance().getTime());
            return super.updateById(${tableName});
        }
        return false;
    }
}

